home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / pc / ps40sdk / examples / common / headers.h / fileutilities.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-04  |  1.8 KB  |  78 lines

  1. /*
  2.     File: FileUtilities.h
  3.  
  4.     Copyright (c) 1996, Adobe Systems Incorporated.
  5.     All rights reserved.
  6.  
  7.     Header file for file utilities.
  8. */
  9.  
  10. #ifndef __FileUtilities_H__
  11. #define __FileUtilities_H__
  12.  
  13. #include "PITypes.h"
  14. #include "PIUtilities.h"
  15.  
  16. /*
  17. //#include <Types.h>
  18. #include <Errors.h>
  19. #include <Files.h>
  20. #include <Resources.h>
  21. //#include <Quickdraw.h>
  22. #include <Aliases.h>
  23. //#include <String.h>
  24. */
  25.  
  26. /***************************************************************/
  27.  
  28. #if MSWindows
  29. typedef    HFILE    FileHandle;
  30. typedef Handle    AliasHandle;
  31. typedef struct
  32.     {    
  33.     char fileName [256];
  34.     } SFReply;
  35.  
  36. OSErr FSWrite(HFILE refNum, long *count, void *buffPtr);
  37. #endif
  38.  
  39. #if Macintosh
  40. #include <StandardFile.h>
  41. #include <LowMem.h>
  42. // On Macintosh systems, FileHandle is a typedef for RefNum
  43. typedef short    FileHandle;
  44. #endif
  45.  
  46. /***************************************************************/
  47.  
  48. Boolean PISetSaveDirectory (Handle alias, Str255 s, 
  49.                    Boolean query,
  50.                    short *rVRefNum);
  51.                    
  52. Boolean TestAndStoreResult (short *res, OSErr result);
  53. #define TSR(x) TestAndStoreResult (&gResult, x)
  54.  
  55. Boolean TestAndStoreCancel (short *res, Boolean tocancel);
  56. #define TSC(x) TestAndStoreCancel (&gResult, x)
  57.  
  58. Boolean PICreateFile (Str255 filename, 
  59.                       short vRefNum,
  60.                       const ResType creator,
  61.                       const ResType type, 
  62.                       FileHandle *fRefNum,
  63.                       short *result);
  64.  
  65. Boolean PICloseFile (Str255 filename, 
  66.                      short vRefNum,
  67.                      FileHandle fRefNum, 
  68.                      Boolean sameNames,
  69.                      Boolean *dirty, 
  70.                      AliasHandle *alias,
  71.                      short *result);
  72.  
  73. void PICloseAndOpenWD(const short vRefNum, const long dirID, short *rVRefNum);
  74.  
  75. /***************************************************************/
  76.  
  77. #endif /* __FileUtilites_H__ */
  78.